/* 
 * File:   tasks.h
 * Author: Administrator
 *
 * Created on 2013?8?24?, ??11:30
 */

#include "commons.h"

#ifndef TASKS_H
#define	TASKS_H

#ifdef	__cplusplus
extern "C" {
#endif




#ifdef	__cplusplus
}
#endif



void test_water(void);
void test_odorA(void);
void test_odorB(void);
void test_odorC(void);
void test_odorD(void);
void test_odorE(void);
void test_odorF(void);
void test_BNC(void);
void test_lick(void);
void AB_BA_Go(int thisdelay, int ITI, float delay_before_reward);
void AA_BB_Go(int thisdelay, int ITI, float delay_before_reward);

void ODNMS(int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, float delay_before_reward);
void ODMS(int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, float delay_before_reward);
void auto_AB_BA_Go_AA_BB_Nogo_Ran(int thisdelay, int interti, int trialNumperSess, float WaterLen, int missstop, int sessstop, float delay_before_reward);
void auto_AA_BB_Go_AB_BA_Nogo_Ran(int thisdelay, int interti, int trialNumperSess, float WaterLen, int missstop, int sessstop, float delay_before_reward);

void Sti2oDNMS_Nogo_onebacktest(int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward);
void Sti2oDNMS_Go_onebacktest(int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward);
void auto_AB_BA_Go_AA_BB_Nogo_Ran_onebacktest(int thisdelay, int interti, int thistrialnum, float WaterLen, int missstop, int sessstop, int delay_before_reward);
void rule_switch_MNM(int thisdelay, int interi, int trialNumperSess, float WaterLen, int thresh, int randomtrial_n, float delay_before_reward);

void AB_BA_Go_AA_BB_Nogo_Ran_blue_delay(int thisdelay, int ITI, int ontrial, int intertrial, int offtrial, int Freq, int PulseOn);
void Sti2oDNMS_Go_opto_delay(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);
void Sti2oDNMS_Nogo_opto_delay(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);

void AB_BA_Go_AA_BB_Nogo_Ran_odor(int thisdelay, int ITI, int ontrial, int intertrial, int offtrial, int Freq, int PulseOn);
void Sti2oDNMS_Go_opto_odor(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);
void Sti2oDNMS_Nogo_opto_odor(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);

void AB_BA_Go_AA_BB_Nogo_Ran_ITI(int thisdelay, int ITI, int ontrial, int intertrial, int offtrial, int Freq, int PulseOn);
void Sti2oDNMS_Go_opto_ITI(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);
void Sti2oDNMS_Nogo_opto_ITI(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);

void AB_BA_Go_AA_BB_Nogo_Ran_8DFir4(int thisdelay, int ITI, int ontrial, int intertrial, int offtrial, int Freq, int PulseOn);
void Sti2oDNMS_Go_opto_8DFir4(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);
void Sti2oDNMS_Nogo_opto_8DFir4(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);

void AB_BA_Go_AA_BB_Nogo_Ran_8DMid4(int thisdelay, int ITI, int ontrial, int intertrial, int offtrial, int Freq, int PulseOn);
void Sti2oDNMS_Go_opto_8DMid4(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);
void Sti2oDNMS_Nogo_opto_8DMid4(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);

void AB_BA_Go_AA_BB_Nogo_Ran_8DLas4(int thisdelay, int ITI, int ontrial, int intertrial, int offtrial, int Freq, int PulseOn);
void Sti2oDNMS_Go_opto_8DLas4(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);
void Sti2oDNMS_Nogo_opto_8DLas4(int sessionNum, int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial);

void NewBurstStimOut(int FreqStim, int DuraStim, int totalStimTime);
void NewBurstStimOut2(int FreqStim, int DuraStim, int totalStimTime);

void CQ_ODMS(int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, float delay_before_reward);
void CQ_ODNMS(int FirstOdorIn, float FirOdorLen, int OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, float delay_before_reward);
void CQ_auto_AB_BA_Go_AA_BB_Nogo_Ran(int thisdelay, int interti, int trialNumperSess, float WaterLen, int missstop, int sessstop, float delay_before_reward);
void CQ_auto_AA_BB_Go_AB_BA_Nogo_Ran(int thisdelay, int interti, int trialNumperSess, float WaterLen, int missstop, int sessstop, float delay_before_reward);

void YWJ_AB_BA_Go_AA_BB_Nogo_Ran_blue_delay(float thisdelay, int ITI, int ontrial, int intertrial, int offtrial, int Freq, int PulseOn, float odoron, float delayon);
void YWJ_Sti2oDNMS_Nogo_opto_delay(int sessionNum, int FirstOdorIn, float FirOdorLen, float OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial, float odoron, float delayon);
void YWJ_Sti2oDNMS_Go_opto_delay(int sessionNum, int FirstOdorIn, float FirOdorLen, float OdorDelayIn, int SecondOdorIn, float SecOdorLen, float WaterLIn, int IntervalIn, int prolong, int delay_before_reward, int Freq, int PulseOn, int ontrial, int intertrial, int offtrial, float odoron, float delayon);

void rule_switch_NMN(int thisdelay, int interti, int trialNumperSess, float WaterLen, int thresh, int randomtrial_n, float delay_before_reward);



void test_odorAB(void);





void Go(int OdorIn, float OdorLen, float WaterLIn, int IntervalIn, int prolong, float delay_before_reward);


void Nogo(int OdorIn, float OdorLen, float WaterLIn, int IntervalIn, int prolong, float delay_before_reward);




void AB_BA_Go2(int thisdelay, int ITI, float delay_before_reward);










extern unsigned char text[16];
extern unsigned char text1[16];
extern unsigned char text2[16];
extern unsigned char text3[16];
extern unsigned char text4[16];
extern unsigned char text5[16];
extern unsigned char text6[16];
extern unsigned char text7_1[16];
extern unsigned char text8_1[16];
extern unsigned char text9[16];
extern unsigned char text10[16];
extern unsigned char text11[16];
extern unsigned char text12[16];
extern unsigned char text7[16];
extern unsigned char text8[16];


extern unsigned char text7_2[16];
extern unsigned char text7_3[16];
extern unsigned char text7_4[16];
extern unsigned char text7_5[16];
extern unsigned char text8_2[16];

extern unsigned int hit, miss, falseAlarm, correctRejection, od, in, correctRatio, discrimRate_oneback, lr, lm, lw, lc;

extern int currentMiss;
extern unsigned int flaga;
extern unsigned int flagb;

struct flagStruct {
    unsigned lick : 1;
    unsigned aa : 1;
    unsigned bb : 1;
    unsigned ab : 1;
    unsigned ba : 1;
    unsigned aca : 1;
    unsigned acb : 1;
    unsigned bca : 1;
    unsigned bcb : 1;
    unsigned ada : 1;
    unsigned adb : 1;
    unsigned bda : 1;
    unsigned bdb : 1;
    unsigned aal : 1;
    unsigned bbl : 1;
    unsigned abl : 1;
    unsigned bal : 1;
    unsigned pun : 1;
    unsigned punable : 1;

};
extern struct flagStruct Flags;



#endif	/* TASKS_H */

